<?xml version="1.0" encoding="ISO-8859-1" ?>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
      <%@ page import="java.sql.*" %>
      <%@ page import="util.MyConnection" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="mani.css" rel="stylesheet" type="text/css" />
<title></title>



</head>
<body>
<div class="shape">
<div id="wrapper">
  <div id="header">
    <div id="logo">
      
    </div>
    <!-- end div#logo -->
  </div>
  <!-- end div#header -->
  <div id="menu">
    <ul>
 <li  class="active"><a href="index.jsp">HOME</a></li>
      
       <li><a href="index.jsp">Logout</a></li>
      
    </ul>
  </div>
  <!-- end div#menu -->
 
  <div id="page">
    <div id="page-bgtop">
      <div id="content">
        <div class="post">
         
          <p class="byline"><div id="center-backgd">
            <table style="background:url(images/cloth_28.jpg) repeat top left;" width="896" height="49">
              <tr>
                <td width="30">&nbsp;</td>
                <td width="854"><table width="853" height="424" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="275" height="15" align="center" valign="top">&nbsp;</td>
                    <td width="36">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="386">
                    
                    <%
//PrintWriter out = response.getWriter();
                    String fname=request.getParameter("name");
            		String lname=request.getParameter("pass");
            		String name=null,uname=null,password=null;
            		
            		if(fname!=null||lname!=null){
            			if(fname.equals("admin@admin.com") && lname.equals("admin")){
            				%>
           		         <jsp:forward page="admin.jsp">
           		         <jsp:param name="label" value="setlabel" />  
           		         </jsp:forward>
           		         <%	
            			}else{
            				ResultSet rs;	
            			
            			
            			
            			try {
            				
            				 
            				  java.sql.Connection conn=MyConnection.getConnection();
            				String sql = "select * from register where email='"+fname+"'and password='"+lname+"'" ;
            				
            				Statement s = conn.createStatement();
            		
            				s.executeQuery (sql);
            				System.out.println(fname+"\n"+lname);
            				rs = s.getResultSet();
            				
            				while (rs.next ())
            				{
            					System.out.println(fname+lname);
            					name=rs.getString("fname");
            					uname=rs.getString("email");
            					password=rs.getString("password");
            					System.out.println(uname+password);
            				}
            				rs.close ();
            				s.close ();
            				}catch(Exception e){
            				System.out.println("Exception is ;"+e);
            				}
            				if(fname.equalsIgnoreCase(uname) && lname.equalsIgnoreCase(password)){
            					 session.setAttribute("eid",uname);
            					 session.setAttribute("name",name);
                		         %>
                		         <jsp:forward page="provider.jsp"></jsp:forward>
                		         <%	 
           		         	 
            				}
		
		 else{
             		%>
                    <jsp:forward page="indexe.jsp"></jsp:forward>
                    <%	
           	}
            		}
         
            		}
%>
                    
                    
                    </td>
                  </tr>
                  <tr>
                    <td height="19">&nbsp;</td>
                  </tr>
                </table></td>
              </tr>
            </table>
          </div></p>
          <div class="meta"> </div>
        </div>
      </div>
      
      <!-- end div#content -->
      <!-- end div#sidebar -->
      <div style="clear: both; height: 1px"></div>
    </div>
  </div>
  <!-- end div#page -->
  <div id="footer">
    <p>Copyright &copy; 2010y <a href="http://www.freecsstemplates.org/">@axess.com</a></p>
    <p id="links"><a href="#">Privacy Policy</a> | <a href="#">Terms of Use</a></p>
  </div>
  <!-- end div#footer -->
</div>
<!-- end div#wrapper -->
</div>
<!-- end shape -->
</body>
</html>